package com.feixiang.dao.impl;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

import com.feixiang.bean.UserInfo;
import com.feixiang.dao.UserInfoDao;

@Repository
public class UserInfoDaoImpl implements UserInfoDao {
	@Autowired
	private HibernateTemplate hibernateTemplate;
	


	public UserInfo getUserInfoById(Integer userId) {
		UserInfo userInfo = new UserInfo();
		try {
			//userInfo = (UserInfo)this.hibernateTemplate.find("from UserInfo u where u.userId=?",userId);
			userInfo = this.hibernateTemplate.get(UserInfo.class, userId);
			System.out.println(userInfo);
			
		} catch (DataAccessException e) {
			System.out.println("�־ò� UserInfoDaoImpl.getUserInfoById()�����쳣!");
		}
		return userInfo;
	}

}
